/*************************************************************************
*  Deklarationen fuer RDS.C
*
*  contact: sebastian.trommer@gmail.com
*  homepage: wiki.car2.de
*
*  Revision History
*
*  when         what  who	why
*
*  2009-02-24	0.00  TSE	initial release
*  2009-02-24	0.10  TSE	aufbau der Konstanten und Variablen
*  2009-03-13	0.11  TSE	Vorberietungen zur Ersterprobung auf Controller
*
***************************************************************************/

#ifndef RDS_H_
#define RDS_H_

#define RDS_TEILER 23
#define ABBRUCH_ZEICHEN 0x01

volatile unsigned long generatormatrix[16] = {
0x77,0x2E7,0x3AF,0x30B,0x359,0x370,0x1B8,0xDC,0x6E,0x37,0x2C7,0x3BF,0x303,0x35D,0x372,0x1B9};

volatile unsigned long offsetwort[5] = {0xFC,0x198,0x168,0x350,0x1B4};

volatile unsigned long *ptr_gm = &generatormatrix[0]; // pointer on generatormatrix

// start RDS blocks
typedef struct {
	unsigned long info, pruef;
} TRDS_block;

TRDS_block RDS_Block_A, RDS_Block_B, RDS_Block_C, RDS_Block_D;

typedef struct
{
 unsigned int
  textende : 1,
  tick : 6,
  norm_akt : 1,
  diffcoded_akt : 1,
  diffcoded_vor : 1,
  position : 7,
  bm_ausgabe : 16,
  neue_gruppe : 1,
  textteil : 7;
} RDS_STATUS;

RDS_STATUS RDS_stat;

volatile unsigned int PICODE = 0x3E;
volatile unsigned int TP = 1; // traffic transmission
volatile unsigned int PTY = 0x1F; // programme type -> science
volatile unsigned int TEXTAB = 	1;

volatile unsigned char PSNAME = 0x30;

volatile unsigned char text[64] = {'F','H',' ','A','u','g','s','b','u','r','g',ABBRUCH_ZEICHEN};
volatile unsigned char *Ptext;

#endif /* RDS_H_ */
